package com.jiangxfei.mymvp.config;

import com.jiangxfei.mymvp.app.home.bean.User;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by 上官林超 on 2017/7/28.
 * todo 创建URL 连接
 */

public interface APIService {
//    @GET("park/parkingHomePage.do?lng=120.376935&lat=36.100045&city=青岛市&isReserve=2&displayType=1&type=1&pageSize=1&currentPage=1")
//    Observable<CarResult<List<CarBean>>> loadUser();

    @GET("users")
    Observable<List<User>> getUsers(@Query("since") int since, @Query("per_page") int perPage);


//    $post_data = array(
//    		'feature' => 'POLYGON((120.390146 36.102752,120.390259 36.102736,120.390433 36.102737,120.390631 36.102764,120.390879 36.10282,120.391225 36.102844,120.391521 36.102839,120.391645 36.102827,120.391591 36.102503,120.391585 36.102169,120.391456 36.10206,120.390242 36.101998,120.390146 36.102752))',
//                    'industryCode' => '07',
//                    'lastSubCodeId' => '113',
//                    'subIndustryCode' => '05_03'
//    );

    @FormUrlEncoded
    @POST("bdgrid/a/api/codes/byFeature")
    Observable<Object> test(@Field("feature") String feature,
                            @Field("industryCode") String industryCode,
                            @Field("lastSubCodeId") String lastSubCodeId,
                            @Field("subIndustryCode") String subIndustryCode);

    @FormUrlEncoded
    @POST("bdgrid/a/login")
    Observable<Object> login(@Field("username") String username,
                             @Field("password") String password);
}


